<?php
namespace Common\Controller;
use Think\Controller;
use Think\Auth;
class BaseController extends Controller {
    public  function _initialize() {
        if (session('name')==null) {
            $this->error('你没有登录！',U('Login/Login'));
        }                   
        if (session('uid')==1 && session('name')==admin) {            
            return TRUE;
        }
       
        $auth = new Auth();
        if (!$auth->check(MODULE_NAME."/".CONTROLLER_NAME."/".ACTION_NAME,session('uid'))) {                 
            $this->error('你没有权限');
        }
    }

}